
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Git 入门教程 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-panel/icons.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-panel/panel.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="linux-manual.html" />
    
    
    <link rel="prev" href="submit-requirement.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    课程设计介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../read-before-starting.html">
            
                <a href="../read-before-starting.html">
            
                    
                    实验前必读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../pa0/">
            
                <a href="../pa0/">
            
                    
                    PA0 - 开发环境配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../pa0/0.1.html">
            
                <a href="../pa0/0.1.html">
            
                    
                    0.1 Installing a GNU/Linux VM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../pa0/0.2.md">
            
                <span>
            
                    
                    0.2 First Step into Linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../pa0/0.3.md">
            
                <span>
            
                    
                    0.3 Installing Basic Tools
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../pa0/0.4.html">
            
                <a href="../pa0/0.4.html">
            
                    
                    0.4 Installing More Tools
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../pa0/0.5.html">
            
                <a href="../pa0/0.5.html">
            
                    
                    0.5 More Exploration
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../pa0/0.6.html">
            
                <a href="../pa0/0.6.html">
            
                    
                    0.6 Logging in and Transferring Files via SSH
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../pa0/0.7.html">
            
                <a href="../pa0/0.7.html">
            
                    
                    0.7 Acquiring Source Code for PAs
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../pa1/">
            
                <a href="../pa1/">
            
                    
                    PA1 - 最简单的计算机
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../pa1/1.1.html">
            
                <a href="../pa1/1.1.html">
            
                    
                    1.1 简易调试器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../pa1/1.2.html">
            
                <a href="../pa1/1.2.html">
            
                    
                    1.2 表达式求值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../pa1/1.3.html">
            
                <a href="../pa1/1.3.html">
            
                    
                    1.3 监视点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../pa2/">
            
                <a href="../pa2/">
            
                    
                    PA2 - 冯诺依曼计算机
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../pa2/2.1.html">
            
                <a href="../pa2/2.1.html">
            
                    
                    2.1 第一个程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../pa2/2.2.html">
            
                <a href="../pa2/2.2.html">
            
                    
                    2.2 基本指令集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../pa2/2.3.html">
            
                <a href="../pa2/2.3.html">
            
                    
                    2.3 输入输出
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../pa3/">
            
                <a href="../pa3/">
            
                    
                    PA3 - 异常和分页
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../pa3/3.1.html">
            
                <a href="../pa3/3.1.html">
            
                    
                    3.1 异常控制流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../pa3/3.2.html">
            
                <a href="../pa3/3.2.html">
            
                    
                    3.2 虚拟地址空间
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../pa4/">
            
                <a href="../pa4/">
            
                    
                    PA4 - 分时多任务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../pa4/4.1.html">
            
                <a href="../pa4/4.1.html">
            
                    
                    4.1 上下文切换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../pa4/4.2.html">
            
                <a href="../pa4/4.2.html">
            
                    
                    4.2 时钟中断
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../lab3.html">
            
                <a href="../lab3.html">
            
                    
                    Lab3 - Cachesim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../问题汇总/">
            
                <a href="../问题汇总/">
            
                    
                    问题汇总
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../问题汇总/PA0.html">
            
                <a href="../问题汇总/PA0.html">
            
                    
                    PA0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../问题汇总/PA1.html">
            
                <a href="../问题汇总/PA1.html">
            
                    
                    PA1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../问题汇总/PA2.html">
            
                <a href="../问题汇总/PA2.html">
            
                    
                    PA2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../问题汇总/PA3.html">
            
                <a href="../问题汇总/PA3.html">
            
                    
                    PA3
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" >
            
                <span>
            
                    
                    评分细则
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../pa0/ScoringRule0.html">
            
                <a href="../pa0/ScoringRule0.html">
            
                    
                    PA0评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../pa1/ScoringRule1.1.html">
            
                <a href="../pa1/ScoringRule1.1.html">
            
                    
                    PA1.1评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../pa1/ScoringRule1.2&1.3.html">
            
                <a href="../pa1/ScoringRule1.2&1.3.html">
            
                    
                    PA1.2&1.3评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../pa2/ScoringRule2.1.html">
            
                <a href="../pa2/ScoringRule2.1.html">
            
                    
                    PA2.1评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../pa2/ScoringRule2.2&2.3.html">
            
                <a href="../pa2/ScoringRule2.2&2.3.html">
            
                    
                    PA2.2&2.3评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../pa3/ScoringRule3.1.html">
            
                <a href="../pa3/ScoringRule3.1.html">
            
                    
                    PA3.1评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" data-path="../pa3/ScoringRule3.2.html">
            
                <a href="../pa3/ScoringRule3.2.html">
            
                    
                    PA3.2评分细则
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="./">
            
                <a href="./">
            
                    
                    杂项
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="submit-requirement.html">
            
                <a href="submit-requirement.html">
            
                    
                    实验提交要求
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.11.2" data-path="git-manual.html">
            
                <a href="git-manual.html">
            
                    
                    Git 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="linux-manual.html">
            
                <a href="linux-manual.html">
            
                    
                    Linux 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="man-manual.html">
            
                <a href="man-manual.html">
            
                    
                    Man 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="markdown-manual.md">
            
                <span>
            
                    
                    Markdown 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="instruction-example.html">
            
                <a href="instruction-example.html">
            
                    
                    指令执行示例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="how-to-read-i386.html">
            
                <a href="how-to-read-i386.html">
            
                    
                    i386 手册阅读指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="i386-typo.html">
            
                <a href="i386-typo.html">
            
                    
                    i386 手册勘误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="software-suggest.html">
            
                <a href="software-suggest.html">
            
                    
                    软件推荐
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Git 入门教程</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="git-&#x7B80;&#x6613;&#x6559;&#x7A0B;">Git &#x7B80;&#x6613;&#x6559;&#x7A0B;</h1>
<h3 id="&#x57FA;&#x672C;&#x4ECB;&#x7ECD;">&#x57FA;&#x672C;&#x4ECB;&#x7ECD;</h3>
<p>Git &#x662F;&#x76EE;&#x524D;&#x4E16;&#x754C;&#x4E0A;&#x6700;&#x5148;&#x8FDB;&#x7684;&#x5206;&#x5E03;&#x5F0F;&#x7248;&#x672C;&#x63A7;&#x5236;&#x7CFB;&#x7EDF;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x7528;&#x5B83;&#x6765;&#x7BA1;&#x7406; PA &#x8BFE;&#x8BBE;&#x7684;&#x7248;&#x672C;&#x66F4;&#x8FED;&#x3002;</p>
<h3 id="&#x5E38;&#x89C1;&#x6982;&#x5FF5;">&#x5E38;&#x89C1;&#x6982;&#x5FF5;</h3>
<p>&#x5DE5;&#x4F5C;&#x533A;&#xFF1A;&#x5728;&#x4F60;&#x7684;&#x8BA1;&#x7B97;&#x673A;&#x4E0A;&#x80FD;&#x770B;&#x5230;&#x7684;&#x76EE;&#x5F55;&#x3002;</p>
<p>&#x7248;&#x672C;&#x5E93;&#xFF1A;&#x53C8;&#x540D;&#x4ED3;&#x5E93;&#xFF0C;&#x662F;&#x65B0;&#x5EFA;&#x7248;&#x672C;&#x5E93;&#x65F6;&#x5728;&#x5DE5;&#x4F5C;&#x533A;&#x4E0B;&#x751F;&#x6210;&#x7684;&#x4E00;&#x4E2A;&#x9690;&#x85CF;&#x76EE;&#x5F55;<code>.git</code>&#xFF08;&#x901A;&#x8FC7; <code>ls -a</code> &#x547D;&#x4EE4;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF09;&#x3002;</p>
<p>&#x6682;&#x5B58;&#x533A;&#xFF1A;&#x5728; Git&#x7684;&#x7248;&#x672C;&#x5E93;&#x4E2D;&#xFF0C;&#x9700;&#x8981;&#x63D0;&#x4EA4;&#x7684;&#x6587;&#x4EF6;&#x4FEE;&#x6539;&#x901A;&#x901A;&#x653E;&#x5230;&#x6682;&#x5B58;&#x533A;&#xFF0C;&#x7136;&#x540E;&#x4E00;&#x6B21;&#x6027;&#x63D0;&#x4EA4;&#x6682;&#x5B58;&#x533A;&#x7684;&#x6240;&#x6709;&#x4FEE;&#x6539; &#x3002;</p>
<p><img src="../images/FAN1Et.jpg" alt=""></p>
<h3 id="&#x5E38;&#x7528;&#x6307;&#x4EE4;">&#x5E38;&#x7528;&#x6307;&#x4EE4;</h3>
<ol>
<li><p>&#x5B89;&#x88C5; <code>git</code></p>
<pre><code class="lang-bash"> sudo apt-get install git
</code></pre>
</li>
<li><p>&#x914D;&#x7F6E; <code>git</code></p>
<pre><code class="lang-bash"> git config --global user.name <span class="hljs-string">&quot;Your Name&quot;</span>
 git config --global user.email <span class="hljs-string">&quot;email@example.com&quot;</span>
</code></pre>
</li>
<li><p>&#x521B;&#x5EFA;&#x7248;&#x672C;&#x5E93;</p>
<pre><code class="lang-bash"> git init <span class="hljs-comment">#&#x5728;&#x5F53;&#x524D;&#x8DEF;&#x5F84;&#x4E0B;&#x521B;&#x5EFA;&#x4ED3;&#x5E93;</span>
</code></pre>
</li>
<li><p>&#x6DFB;&#x52A0;&#x6587;&#x4EF6;&#x5230;&#x5F53;&#x524D;&#x4ED3;&#x5E93;</p>
<pre><code class="lang-bash"> git add readme.txt
 git commit -m <span class="hljs-string">&quot;write a readme file&quot;</span>    <span class="hljs-comment">#&#x63CF;&#x8FF0;&#x6B64;&#x6B21;&#x6539;&#x52A8;&#x7684;&#x8BF4;&#x660E;&#x4FE1;&#x606F;</span>
</code></pre>
</li>
<li><p>&#x67E5;&#x770B;&#x63D0;&#x4EA4;&#x5386;&#x53F2;</p>
<pre><code class="lang-bash"> git <span class="hljs-built_in">log</span>    <span class="hljs-comment">#&#x6BCF;&#x6B21;&#x6539;&#x52A8;&#x4E4B;&#x524D;&#x63D0;&#x4EA4;&#x7684;&#x8BF4;&#x660E;&#x4FE1;&#x606F;</span>
</code></pre>
</li>
<li><p>&#x7248;&#x672C;&#x56DE;&#x9000;</p>
<pre><code class="lang-bash"> git reflog <span class="hljs-comment">#&#x5148;&#x7528; git log/reflog &#x67E5;&#x770B;commitID</span>
 git reset --hard commitID
 git reset --hard HEAD^ <span class="hljs-comment">#&#x56DE;&#x9000;&#x5230;&#x4E0A;&#x4E00;&#x4E2A;&#x7248;&#x672C;</span>
</code></pre>
</li>
<li><p>&#x5220;&#x9664;&#x7248;&#x672C;&#x5E93;&#x4E2D;&#x7684;&#x6587;&#x4EF6;</p>
<pre><code class="lang-bash"> git rm readme.txt
</code></pre>
</li>
<li><p>&#x8FD8;&#x539F;&#x8BEF;&#x5220;&#x7684;&#x5DE5;&#x4F5C;&#x533A;&#x7684;&#x6587;&#x4EF6;</p>
<pre><code class="lang-bash"> git checkout --readme.txt
</code></pre>
<p> <code>git checkout</code> &#x5176;&#x5B9E;&#x662F;&#x7528;&#x7248;&#x672C;&#x5E93;&#x91CC;&#x7684;&#x7248;&#x672C;&#x66FF;&#x6362;&#x5DE5;&#x4F5C;&#x533A;&#x7684;&#x7248;&#x672C;</p>
</li>
<li><p>&#x514B;&#x9686;&#x8FDC;&#x7A0B;&#x5E93;&#x5230;&#x672C;&#x5730;</p>
<pre><code class="lang-bash"> git <span class="hljs-built_in">clone</span> https://github.com/your_github_name/your_hub.git <span class="hljs-comment">#https&#x901F;&#x5EA6;&#x8F83;&#x6162;</span>
 git <span class="hljs-built_in">clone</span> git@github.com:your_github_name/your_hub.git<span class="hljs-comment">#&#x514B;&#x9686;&#x5728;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x4E0B;</span>
</code></pre>
</li>
<li><p>&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x5173;&#x8054;&#x8FDC;&#x7A0B;&#x5E93;</p>
<ul>
<li><p>&#x521B;&#x5EFA;<code>SSH Key</code>&#x7684;&#x79D8;&#x94A5;&#x5BF9;</p>
<pre><code class="lang-bash">ssh-keygen -t rsa -C <span class="hljs-string">&quot;your_email@example.com&quot;</span>    <span class="hljs-comment">#&#x4E00;&#x5F00;&#x59CB;&#x914D;&#x7F6E;&#x7684;git&#x7684;&#x90AE;&#x7BB1;</span>
</code></pre>
<p>&#x8F93;&#x5B8C;&#x8FD9;&#x6761;&#x547D;&#x4EE4;&#x4E4B;&#x540E;&#x4E00;&#x8DEF;&#x56DE;&#x8F66;&#x4E0D;&#x9700;&#x8981;&#x8BBE;&#x7F6E;&#x5404;&#x79CD;&#x5BC6;&#x7801;&#xFF0C;&#x7136;&#x540E;&#x5728;<code>/root</code>&#x76EE;&#x5F55;&#x4E0B;&#x8FDB;&#x5165;.ssh&#x6587;&#x4EF6; &#xFF0C;<code>id_rsa</code>&#x4E3A;&#x79C1;&#x94A5;&#xFF08;&#x4E0D;&#x80FD;&#x6CC4;&#x9732;&#xFF09;&#xFF0C; <code>id_ras.pub</code> &#x4E3A;&#x516C;&#x94A5;&#x3002;&#x5230;&#x81EA;&#x5DF1;&#x7684; github &#x7684; <code>Settings</code>&#x4E0B;&#x7684;<code>SSH and GPG keys</code>&#x4E0B;&#x6DFB;&#x52A0;&#x81EA;&#x5DF1;&#x7684;&#x516C;&#x94A5;&#x5373;&#x53EF;&#x3002;</p>
<p><img src="../images/FAdnvF.png" alt="FAdnvF.png"></p>
</li>
<li><p>&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x5173;&#x8054;</p>
<pre><code class="lang-bash">git remote add origin git@github.com:your_github_name/your_hub.git
git push -u origin master    <span class="hljs-comment">#&#x7B2C;&#x4E00;&#x6B21;&#x63A8;&#x9001;master&#x5206;&#x652F;&#x7684;&#x6240;&#x6709;&#x5185;&#x5BB9;</span>
git push origin master    <span class="hljs-comment">#&#x63A8;&#x9001;&#x6700;&#x65B0;&#x4FEE;&#x6539;</span>
</code></pre>
<p>&#x5982;&#x679C;&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x975E;&#x7A7A;&#x4ED3;&#x5E93;&#xFF0C;&#x9700;&#x8981;<code>git pull origin master</code>&#xFF0C;&#x5C06;&#x8FDC;&#x7A0B;&#x7684;&#x4EE3;&#x7801;&#x62C9;&#x5230;&#x672C;&#x5730;&#x3002;</p>
</li>
</ul>
</li>
<li><p>&#x521B;&#x5EFA;&#x4E0E;&#x5408;&#x5E76;&#x5206;&#x652F;</p>
<ul>
<li><p>&#x67E5;&#x770B;&#x6240;&#x6709;&#x5206;&#x652F;</p>
<pre><code class="lang-bash">git branch
</code></pre>
<p>&#x5728; <code>master</code> &#x5206;&#x652F;&#x4E0B;&#x521B;&#x5EFA; <code>pa1</code> &#x5206;&#x652F;&#xFF0C;&#x7136;&#x540E;&#x5207;&#x6362;&#x5230; <code>pa1</code> &#x5206;&#x652F;</p>
<pre><code class="lang-bash">git checkout -b pa1
</code></pre>
<p>&#x4EE5;&#x4E0A;&#x547D;&#x4EE4;&#x76F8;&#x5F53;&#x4E8E;&#x4EE5;&#x4E0B;&#x4E24;&#x6761;&#x547D;&#x4EE4;&#xFF1A;</p>
<pre><code class="lang-bash">git branch pa1         <span class="hljs-comment">#&#x521B;&#x5EFA;&#x5206;&#x652F;pa1</span>
git checkout pa1    <span class="hljs-comment">#&#x5207;&#x6362;&#x5230;&#x5206;&#x652F;pa1</span>
</code></pre>
<p>&#x6267;&#x884C;&#x4E4B;&#x540E;&#xFF0C;&#x76EE;&#x524D;&#x5728; <code>pa1</code> &#x5206;&#x652F;&#x4E0A;&#xFF0C;&#x53EF;&#x4EE5;&#x7528; <code>git branch</code> &#x547D;&#x4EE4;&#x67E5;&#x770B;&#x3002;</p>
</li>
<li><p>&#x5728; <code>pa1</code> &#x5206;&#x652F;&#x4E0B;&#x5F00;&#x53D1;</p>
<pre><code class="lang-bash">git add file
git commit -m <span class="hljs-string">&apos;...&quot;
</span></code></pre>
<p>&#x8DDF; <code>master</code> &#x4E0B;&#x5F00;&#x53D1;&#x66F4;&#x8FED;&#x5E76;&#x65E0;&#x4E24;&#x6837;&#x3002;&#x5F53;&#x524D;&#x7248;&#x672C;&#x5F00;&#x53D1;&#x5B8C;&#x6210;&#x4E4B;&#x540E;&#xFF0C;&#x5207;&#x56DE;&#x5230; <code>master</code> &#x5206;&#x652F;&#xFF1A;</p>
<pre><code class="lang-bash">git checkout master
</code></pre>
</li>
<li><p>&#x5408;&#x5E76;&#x5220;&#x9664; <code>pa1</code> &#x5206;&#x652F;</p>
<pre><code class="lang-bash">git merge pa1 
git branch <span class="hljs-_">-d</span> pa1
</code></pre>
<p>&#x5BF9;&#x4E8E;&#x4E0D;&#x9700;&#x8981;&#x5408;&#x5E76;&#x7684;&#x5206;&#x652F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>git branch -D pa1</code> &#x5220;&#x9664;&#x3002;</p>
</li>
</ul>
</li>
<li><p>&#x89E3;&#x51B3;&#x51B2;&#x7A81;</p>
<p>&#x5F53;&#x5206;&#x652F; <code>pa1</code> &#x4E0E; <code>master</code> &#x90FD;&#x6709;&#x65B0;&#x7684;&#x63D0;&#x4EA4;&#x65F6;&#xFF0C;&#x6267;&#x884C; <code>git merge pa1</code> &#x4E4B;&#x540E;&#x53EA;&#x80FD;&#x624B;&#x52A8;&#x4FEE;&#x6539;&#x6587;&#x4EF6;&#xFF08;&#x5C3D;&#x7BA1;&#x6709;&#x63D0;&#x793A;&#x4E0D;&#x540C;&#x5206;&#x652F;&#x7684;&#x4EE3;&#x7801;&#x533A;&#x522B;&#xFF0C;&#x4F46;&#x662F;&#x4F9D;&#x65E7;&#x5F88;&#x9EBB;&#x70E6;&#xFF09;&#xFF0C;&#x6700;&#x597D;&#x7684;&#x505A;&#x6CD5;&#x5C31;&#x662F;&#x907F;&#x514D;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x7684;&#x53D1;&#x751F;&#x3002;&#x5BF9;&#x4E8E; PA &#x9879;&#x76EE;&#x7BA1;&#x7406;&#xFF0C;&#x6211;&#x4EEC;&#x7ED9;&#x51FA;&#x7684;&#x5EFA;&#x8BAE;&#x662F;&#x5F53;&#x65B0;&#x5EFA;&#x5206;&#x652F;&#x4E4B;&#x540E;&#xFF0C;master &#x5206;&#x652F;&#x4E0A;&#x5C31;&#x4E0D;&#x8981;&#x518D;&#x505A;&#x63D0;&#x4EA4;&#xFF0C;&#x76F4;&#x5230;&#x5B50;&#x5206;&#x652F;&#x5408;&#x5E76;&#x5230; master &#x4E4B;&#x540E;&#x518D;&#x63D0;&#x4EA4;&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#x3002;</p>
</li>
<li><p>&#x63A8;&#x9001;&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;</p>
<pre><code class="lang-bash">git remote -v              <span class="hljs-comment">#&#x67E5;&#x770B;&#x8FDC;&#x7A0B;&#x4FE1;&#x606F;&#x5E93;</span>
git remote remove origin <span class="hljs-comment">#&#x5220;&#x9664;origin&#x8FDC;&#x7A0B;&#x5E93;</span>
git push origin master      <span class="hljs-comment">#&#x5C06;master&#x4E0A;&#x7248;&#x672C;&#x63A8;&#x9001;&#x5230;origin&#x4E0A;</span>
</code></pre>
</li>
</ol>
<h3 id="&#x8865;&#x5145;&#x8BF4;&#x660E;">&#x8865;&#x5145;&#x8BF4;&#x660E;</h3>
<p>Git &#x7684;&#x66F4;&#x591A;&#x5E94;&#x7528;&#x5982;&#x591A;&#x4EBA;&#x534F;&#x4F5C;&#x5F00;&#x53D1;&#x7248;&#x672C;&#x66F4;&#x8FED;&#x3001;&#x5F53;&#x524D;&#x6B63;&#x5728;&#x5B50;&#x5206;&#x652F;&#x4E0A;&#x5F00;&#x53D1;&#x4F46;&#x662F;&#x7A81;&#x7136;&#x53D1;&#x73B0;&#x4E3B;&#x5206;&#x652F;&#x4E0A;&#x6709; Bug &#x7B49;&#x7B49;&#x7531;&#x4E8E;&#x4E0D;&#x7275;&#x626F;&#x5230; PA &#x9879;&#x76EE;&#x7684;&#x7BA1;&#x7406;&#x6240;&#x4EE5;&#x5728;&#x6B64;&#x4E0D;&#x505A;&#x4ECB;&#x7ECD;&#xFF0C;&#x5177;&#x4F53;&#x53EF;&#x4EE5;&#x81EA;&#x884C;&#x5728;&#x7F51;&#x4E0A;&#x641C;&#x7D22;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="submit-requirement.html" class="navigation navigation-prev " aria-label="Previous page: 实验提交要求">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="linux-manual.html" class="navigation navigation-next " aria-label="Next page: Linux 入门教程">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Git 入门教程","level":"1.11.2","depth":2,"next":{"title":"Linux 入门教程","level":"1.11.3","depth":2,"path":"others/linux-manual.md","ref":"others/linux-manual.md","articles":[]},"previous":{"title":"实验提交要求","level":"1.11.1","depth":2,"path":"others/submit-requirement.md","ref":"others/submit-requirement.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["panel","-sharing"],"pluginsConfig":{"panel":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"others/git-manual.md","mtime":"2022-03-02T14:57:50.207Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-06-05T09:31:00.205Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

